package com.totcy.atom.adapter;

import android.content.Context;
import android.view.ViewGroup;

import com.totcy.atom.R;
import com.totcy.atom.bean.MMVideoBean;
import com.totcy.atom.utils.glide.GlideUtil;
import com.totcy.baselibrary.adapter.BaseLoadMoreAdapter;
import com.totcy.baselibrary.adapter.BaseViewHolder;

import java.util.List;

import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;

public class MMVideoAdapter extends BaseLoadMoreAdapter<MMVideoBean, BaseViewHolder, BaseViewHolder> {

    public MMVideoAdapter(Context mContext, List<MMVideoBean> mDatas) {
        super(mContext, mDatas);
    }

    @Override
    protected BaseViewHolder onCreateItemViewHolder(ViewGroup parent, int viewType) {
        return new BaseViewHolder(getItemView(R.layout.item_mm_video, parent));
    }

    @Override
    protected void onBindItemViewHolder(BaseViewHolder holder, int position) {
        JzvdStd jzvdStd = holder.getView(R.id.videoplayer);
        MMVideoBean mmVideoBean = mDatas.get(position);

        jzvdStd.setUp(mmVideoBean.getLink_url()
                , mmVideoBean.getLink_description(),
                Jzvd.SCREEN_WINDOW_LIST);
        GlideUtil.loadImage(mContext, mmVideoBean.getLink_image_url(), jzvdStd.thumbImageView);

    }

    @Override
    public boolean hasHeader() {
        return false;
    }

    @Override
    protected BaseViewHolder onCreateHeaderViewHolder(ViewGroup parent, int viewType) {
        return null;
    }

    @Override
    protected void onBindHeaderViewHolder(BaseViewHolder holder) {

    }
}
